#ifndef FTIPS_POINTSCLASSIFIER_H_
#define FTIPS_POINTSCLASSIFIER_H_

#include <list>

namespace ftips {

	// Class: To classify one-dimensional circle points using K-medoids algorithm
	class PointsClassifier {
		// private constant
	private:
		static const int DSML_UPPERBOUND = 40; // dissimilarity upperbound
		static const int MAX_CLASS_NUM = 10;
		static const int MAX_INDIVIDUAL_NUM = 80; // max individual number of each class

		// private class variables
	private:
		int m_classifier[MAX_CLASS_NUM][MAX_INDIVIDUAL_NUM][2]; // 0 for the point value; 1 for the dissimilarity sum to others
		int m_classCenters[MAX_CLASS_NUM]; // center point of each class
		int m_individualNums[MAX_CLASS_NUM]; // actual individual number of each class
		int m_classNum; // actual class number
		int m_total; // contour

		// private methods
	private:
		int CalDissimilarity(int point1, int point2);
		int CalCenterDissimilarity(int classIndex, int point);
		int CalCenter(int classIndex);
		void RefreshDis(int classIndex, int point);
		bool CreateNewClass(int point);

		// public methods
	public:
		PointsClassifier(int total);
		void Kmedoids(int point);
		int GetIndividualNum(int classIndex);
		int GetClassCenter(int classIndex);
		int GetClassNum();
		void GetClassIndividualPoints(int classIndex, std::list<int> *pointsList);
	};

}

#endif